<template>
	<!-- 搜索 -->
	<view class="contain">
		<view class="flex flex-col status_bar search" :style="'padding-top:'+(headheight+3)+'px;'">
			<view class="w-[70%] ml-2"><u-search placeholder="珠江啤酒" bgColor="#FFFFFF" shape="square" :showAction="false" v-model="keyword"></u-search></view>
		</view>
	</view> <!-- contain End -->
</template>

<script setup lang='ts'>
import { ref,reactive } from 'vue'
import {  onLoad,onShow,onShareAppMessage,onShareTimeline } from '@dcloudio/uni-app'
import {ChineseDate} from '@/common/date.js'
import { userStore } from '@/stores/userStore'
let { hasLogin,userData } = userStore();

let winWidth=ref(uni.$tools.GetScreenWidth());
let winHeight=ref(uni.$tools.GetScreenHeigth());
let headheight=ref(uni.getSystemInfoSync().statusBarHeight);

let keyword=ref('');

//检查登录
const checkLogin=(url:string)=>{
	let msg="请登录后操作";
	if(hasLogin===false || userData.userinfo===null){
		if(url.indexOf("buy")!=-1){
			msg="请登录后购买，点击【确定】继续";
			uni.showModal({
					title:"温馨提示",
					content:msg,
					showCancel:true,
			})
			return false;
		}
		return true;
	}
	return true;
}



const updateLoginTime=()=>{
	//  if(userData.userinfo.id!=null || userData.userinfo.id!=''){
	// 	let paraData={
	// 		id:userData.userinfo.id
	// 	}
	// 	console.log("更新时间参数:",paraData);
	// 	uni.$tools.Reqeust('/api/updateLoginTime',paraData,'POST').then((res:any)=>{
	// 		console.log(res);
	// 		if(res.data.code===200){
				
	// 		}
	// 	});	
	// }
}


onShow(()=>{
	//updateLoginTime();//更新用户登录时间
	console.log(winWidth,winHeight)
	uni.$tools.Toast(winWidth+","+winHeight);
});


onShareAppMessage(()=>{
       return {
		   title: '秒杀特惠', //分享的名称
		   path: '/pages/index/index',//分享详情页面时，需要把所需参数代入
		   mpId: 'wxb73b250f36ad01d2', //此处配置微信小程序的AppId
	   };
});

onShareTimeline(()=>{
       return {
		   title: '广心智康云愈心理', //分享的名称
		   type:0,
		   summary:'广心智康云愈心理',
	   };
})

</script>
<style>
	page{
		background:#ff5f57;
		padding-bottom:200rpx;
	}
</style>
<style lang='scss' scoped>
	@import "index.scss";
</style>